/**
 * 首页面
 */

import {
  imageUrl,
  productList,
} from '/common/config';

Page({
  data: {
    SOFAStack: `${imageUrl}/RvZETmFHQIqVLHzNLXXB.png`,
    productList,
  },
  onLoad() {},
  handleToLottery() {
    my.navigateTo({
      url: '/pages/lottery/lottery',
    });
  },
  handleSaveQrcode() {
    const url = 'https://gw.alipayobjects.com/zos/rmsportal/azfRpRFpwsggAAZuVDzZ.jpg';
    my.confirm({
      title: '保存提示',
      content: '确认将二维码保存到本地？',
      success: (res) => {
        if (res.confirm) {
          my.saveImage({
            url,
            success() {
              my.showToast({
                type: 'success',
                content: '二维码保存成功',
              });
            },
            fail(res) {
              my.showToast({
                type: 'fail',
                content: '二维码保存失败',
              });
            }
          });
        }
      },
    });
  },
});
